IF("${GPROF}" EQUAL 1)
    ADD_COMPILE_OPTIONS(-pg)
ENDIF()
IF("${USE_REGPARM}" EQUAL 1)
    ADD_COMPILE_OPTIONS(-DCONFIG_REGPARM=3)
ENDIF()
IF("${HAVE_STATS}" EQUAL 1)
    ADD_COMPILE_OPTIONS(-DHAVE_STATS=1)
ENDIF()
IF("${USE_COMPATIBLE_MODE}" EQUAL 1)
    ADD_COMPILE_OPTIONS(-DUSE_COMPATIBLE_MODE=1)
ENDIF()
IF("${HAVE_ASSERT_LOG}" EQUAL 1)
    ADD_COMPILE_OPTIONS(-DHAVE_ASSERT_LOG=1)
ENDIF()

FILE(GLOB SRC_LIST1 ./*.c)
FILE(GLOB SRC_LIST2 ./common/*.c)
FILE(GLOB SRC_LIST3 ./event/*.c)
FILE(GLOB SRC_LIST4 ./hashkit/*.c)
FILE(GLOB SRC_LIST5 ./proto/*.c)

INCLUDE_DIRECTORIES(
    .
    ./common 
    ./event 
    ./hashkit 
    ./proto)

LINK_LIBRARIES(rt) 
LINK_LIBRARIES(mxml)
LINK_LIBRARIES(pthread)

ADD_DEFINITIONS ("-D_GNU_SOURCE")

ADD_EXECUTABLE(dtcagent ${SRC_LIST1} ${SRC_LIST2} ${SRC_LIST3} ${SRC_LIST4} ${SRC_LIST5})

